package com.btpj.hospital_server.service;

import com.btpj.hospital_server.mapper.VisitAppointmentMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class VisitAppointmentService {

    @Resource
    private VisitAppointmentMapper visitAppointmentMapper;

    /**
     * 获取指定出诊编号和时间段已预约的数量(剔除掉已取消预约的)
     *
     * @param planId     出诊编号
     * @param timePeriod 时间段
     * @return 已预约的数量
     */
    public Integer getAppointmentNum(Long planId, Integer timePeriod) {
        return visitAppointmentMapper.selectByPlanIdAndTimePeriod(planId, timePeriod);
    }
}
